"use strict";
cc._RF.push(module, '96293gM6rZEcIjGTqSuNop0', 'ClickBase');
// scripts/Game/Base/ClickBase.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
var ClickBase = /** @class */ (function (_super) {
    __extends(ClickBase, _super);
    function ClickBase() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.canClick = true;
        _this.down = false;
        return _this;
    }
    ClickBase.prototype.OnDown = function () {
        this.down = true;
    };
    ClickBase.prototype.OnUp = function () {
        this.down = false;
    };
    ClickBase.prototype.onLoad = function () {
        this.node.on(cc.Node.EventType.TOUCH_START, this.ClickDown, this);
        this.node.on(cc.Node.EventType.TOUCH_CANCEL, this.ClickUp, this);
        this.node.on(cc.Node.EventType.TOUCH_END, this.ClickUp, this);
        this.node.on(cc.Node.EventType.TOUCH_START, this.OnDown, this);
        this.node.on(cc.Node.EventType.TOUCH_CANCEL, this.OnUp, this);
        this.node.on(cc.Node.EventType.TOUCH_END, this.OnUp, this);
    };
    ClickBase.prototype.lateUpdate = function (dt) {
        if (!this.down) {
            return;
        }
        this.OnDowning(dt);
    };
    return ClickBase;
}(cc.Component));
exports.default = ClickBase;

cc._RF.pop();